package com.ssc.ssc.controller;

import com.ssc.ssc.dao.UserMapper;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
public class LoginController {
	
	@Resource
	private UserMapper user;
	
	@RequestMapping("/login")
	@ResponseBody
	public HashMap login(HttpServletRequest req, HttpServletResponse resp) throws Exception {
		
		System.out.println(user.selectAll().toString());
		
		HashMap map = new HashMap();
		map.put("status", true);
		map.put("url", "/main");
		map.put("info", "登录成功");
		return map;
	}
	
	@RequestMapping("/main")
	public String list(HttpServletRequest req, HttpServletResponse resp) {
		
		req.setAttribute("qwe", "qqqqqqqqqqqqqqqq");
		return "main";
	}
}